<!--[if ie 6]>
      <style type="text/css">
      div#content div.buttonMinibox{width:200px;display:inline;float:none;overflow: hidden;}
      div#content div.buttonBox{width:600px;height:30px;}
      </style>
<![endif]-->

<?php
	echo $accessibility->whereIAm($pageTitle,array(array('title'=>'Formulários - Modelos','link'=>'/ftemplates'),array('title'=>'Visualizar modelo')));
	
	echo "<h2 id='contentTitle'>".$pageTitle."</h2>";
	
	
	echo "<div id='view'>";
	//echo "<p><label>ID: </label><span>".$ftemplate['Ftemplate']['id']."</span></p>";
	echo "<p><label>Nome: </label><span>".$ftemplate['Ftemplate']['name']."</span></p>";
	echo "<p><label>Descrição: </label><span>".$ftemplate['Ftemplate']['description']."</span></p>";
	echo "<br />";
	
	$tipo_dados = array(
					'string'=>'Texto',
					'texto'=>'Texto grande',
					'inteiro'=>'Numero',
					'data'=>'Data',
					'file'=>'Arquivo'
				);
	foreach ($campos as $campo) {
		echo "<div id='field' style=\"border:solid 1px; padding:10px; margin:10px;\">";
		echo "<p><label>Nome do campo: </label><span>".$campo['Fctemplate']['name']."</span></p>";
		echo "<p><label>Tipo do campo: </label><span>".$tipo_dados[$campo['Fctemplate']['type']]."</span></p>";
		echo "<p><label>Descricao do campo: </label><span>".$campo['Fctemplate']['description']."</span></p>";
		echo "<p><label>Texto de ajuda: </label><span>".$campo['Fctemplate']['help']."</span></p>";
		echo "</div>";
	}
	
	/* Botoes - Inicio */
	$entity = 'ftemplates';
	$model = 'Ftemplate';
	$label = 'modelo';
	$label_plural = 'modelos';
	
	echo "<div class='buttonBox'>";
	echo "<div class='buttonMinibox'>";
	$listButton = "<span class=\"buttonList\">Listar ".$label_plural."</span>";
	echo html_entity_decode($html->link($listButton, '/'.$entity.'/',array('class'=>'button')));
	echo "</div>";
	echo "<div class='buttonMinibox'>";
	if ($othAuth->hasPermission($entity.'/edit/')) {
		$editButton = "<span class=\"buttonEdit\">Editar ".$label."</span>";
		echo html_entity_decode($html->link($editButton, '/'.$entity.'/edit/'.$ftemplate[$model]['id'],array('class'=>'button')));
	}
	echo "</div>";
	
	echo "<div class='buttonMinibox'>";
	if ($othAuth->hasPermission($entity.'/delete/')) {
		$deleteButton = "<span class=\"buttonDelete\">Apagar ".$label."</span>";
		echo html_entity_decode($html->link($deleteButton,'/'.$entity.'/delete/'.$ftemplate[$model]['id'], array('class'=>'button'), 'Confirma a exclusão deste item?'));
	}
	echo "</div>";
	
	echo "<div class='buttonMinibox'>";
	if ($othAuth->hasPermission($entity.'/copy/')) {
		$copyButton = "<span class=\"buttonCopy\">Copiar modelo</span>";
		echo html_entity_decode($html->link($copyButton, '/'.$entity.'/copy/'.$ftemplate[$model]['id'],array('class'=>'button')));		
	}
	echo "</div>";
	
	echo "</div>";
	/* Botoes - Fim */
	echo "</div>";

